import React, {Component} from 'react';

const data = [
    {id: '1', content: '你好中国'},
    {id: '2', content: '你好你好'},
    {id: '3', content: '你好我不好'}
]

class Detail extends Component {
    render() {
        //接收params参数
        let {id, title} = this.props.match.params
        let result = data.find((obj) => {
            return obj.id === id
        })
        return (
            <div className="thumbnail">
                <div className="caption">
                    <h3>{title}</h3>
                    <p>{id}</p>
                    <p>{result.content}</p>
                </div>
            </div>
        )
    }
}

export default Detail;